<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
    <meta charset="utf-8">
</head>
<body>
    <div>
        <input id="a" type="text"></input>+
        <input id="b" type="text"></input>=
        <span id="result">0</span>
        <button id="add" onclick="clickAdd()">add</button>
    </div>
    <script type="text/javascript">
        function clickAdd(){
            document.getElementById("result").innerHTML = parseInt(document.getElementById("a").value)+parseInt(document.getElementById("b").value)
        }
    </script>
</body>
</html>